# - Config file for the nCine package
# It defines the following variables
#   NCINE_VERSION, the nCine version string
#   NCINE_DYNAMIC_LIBRARY, set to true if the nCine library is compiled as dynamic
#   NCINE_TESTS_DATA_DIR, the directory containing the data for the tests
#   NCINE_ANDROID_DIR, the directory containing the Android library and additional files
#   NCINE_EMBEDDED_SHADERS, set to true if shaders are embedded in the library
#   NCINE_SHADERS_DIR, the directory containing the shaders if they are not embdedded

set(NCINE_VERSION "@NCINE_VERSION@")
@PACKAGE_INIT@

if(NOT TARGET ncine AND NOT TARGET ncine::ncine)
	include("${CMAKE_CURRENT_LIST_DIR}/nCineTargets.cmake")
endif()

set(NCINE_DYNAMIC_LIBRARY @NCINE_DYNAMIC_LIBRARY@)

find_path(NCINE_TESTS_DATA_DIR
	NAMES scripts/script.lua sounds/music.ogg textures/texture1.png
	PATHS "${PACKAGE_PREFIX_DIR}/@DATA_INSTALL_DESTINATION@/" "${CMAKE_CURRENT_LIST_DIR}/../nCine-data/"
	DOC "Path to the data directory for tests")

find_path(NCINE_ANDROID_DIR
	NAMES app/src/main/cpp/ncine/include/ncine/AndroidApplication.h
	PATHS "${PACKAGE_PREFIX_DIR}/@ANDROID_INSTALL_DESTINATION@/" "${CMAKE_CURRENT_LIST_DIR}/android"
	DOC "Path to the Android directory")

set(NCINE_EMBEDDED_SHADERS @NCINE_EMBED_SHADERS@)
if(NOT NCINE_EMBEDDED_SHADERS)
	find_path(NCINE_SHADERS_DIR
		NAMES sprite_vs.glsl textnode_vs.glsl
		PATHS "${PACKAGE_PREFIX_DIR}/@SHADERS_INSTALL_DESTINATION@/" "${NCINE_TESTS_DATA_DIR}/shaders" "${CMAKE_CURRENT_LIST_DIR}/../nCine/src/shaders"
		DOC "Path to the shaders directory")
endif()
